<template>
	<view>
		<view v-if="types==0">
			<view class="content" >
				<view class="codiv">
					<view class="coBar">状态</view>
					<view class="cnValue">
						<span v-if="getDel.status==1">待参加</span>
						<span v-if="getDel.status==2">待审核</span>
						<span v-if="getDel.status==3">已通过</span>
						<span v-if="getDel.status==4" style="color: red;">已驳回</span>
					</view>
				</view>
				<view v-if="getDel.status==1||getDel.status==2||getDel.status==3">
					<view class="codiv">
						<view class="coBar">机构名称</view>
						<view class="cnValue">{{getDel.name}}</view>
					</view>
					<view class="codiv">
						<view class="coBar">联系人</view>
						<view class="cnValue">{{getDel.contact}}</view>
					</view>
					<view class="codiv">
						<view class="coBar">职务</view>
						<view class="cnValue">{{getDel.post}}</view>
					</view>
					<view class="codiv  women">
						<view class="coBar">联系方式</view>
						<view class="cnValue">{{getDel.phone}}</view>
					</view>
				</view>
				<view v-if="getDel.status==4">
					<view class="codiv">
						<view class="coBar">机构名称</view>
						<input class="cnValue" v-model="name">
					</view>
					<view class="codiv">
						<view class="coBar">联系人</view>
						<input class="cnValue"  v-model="contact">
					</view>
					<view class="codiv">
						<view class="coBar">职务</view>
						<input class="cnValue"  v-model="post">
					</view>
					<view class="codiv  women">
						<view class="coBar">联系方式</view>
						<input class="cnValue"  v-model="phone">
					</view>
					<button type="primary" class="resubmit" @click="newbutton">重新提交</button>
				</view>
			</view> 
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				organization_name:'',
				name:'',
				contact:'',
				post:'',
				phone:'',
				getDel:[],
				id:'',
				types:'',
				status:''
			}
		},
		onLoad(e) {
			console.log('1111111111'+e)
			this.Getdetail(e.id)
			this.postAct()
			this.types=uni.getStorageSync('types')
		},
		methods: {
			Getdetail(e){
				this.$get('v1/user/getmessage',{id:e})
				.then(res=>{
					this.getDel=res.data
					console.log(res)
				})
			},
			postAct(){
				this.$post('v1/actives/act-edit',{
					id:this.id,
					organization_name:this.organization_name,
					contact:this.contact,
					post:this.post,
					phone:this.phone
				})
				.then(res=>{
					if(this.organization_name&&this.contact&&this.post&&this.phone){
						uni.showToast({
							title:'信息不能为空！'
						})
					}
				})
			},
			newbutton(id){
				this.$post('v1/actives/resubmission')
				.then(res=>{
					uni.navigateTo({
						url:'../perActiveApply/perActiveApply?id='+id
					})
				})
			}
		}
	}
</script>

<style>
.codiv{
	border-bottom: 2rpx solid #EAEAEA;
	padrpxg: 0 20rpx;
	line-height:80rpx ;
	margin: 0 20rpx;
	display: flex;
	padding: 30rpx 0;
}
.coBar{
	font-size: 30rpx;
	width: 250rpx;
}
.cnValue{
	color: #999;
	font-size: 28rpx;
}
.women{
	border:0
}
.resubmit{
	background-color: #C30D24;
	line-height: 80rpx;
	border-radius: 50rpx;
	/* margin: 0rpx 70rpx; */
	width: 600rpx;
	position: absolute;
	bottom: 30rpx;
	left: 70rpx;
}

</style>
